#define ElemType int

#include "common.h"

int findPeakElement(int* nums, int numsSize);

int main()
{
	return 0;
}

int findPeakElement(int* nums, int numsSize)
{
	/* 注意有边界 - 判断条件溢出 */
	int lo = 0, hi = numsSize - 1;
	while (lo < hi) {
		int mid = lo + (hi - lo >> 1);
		if (nums[mid] < nums[mid + 1])
			lo = mid + 1;
		else
			hi = mid;
	}
	return lo;
}
